.class public Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;
.super Lcom/bitauto/autoeasy/BaseActivity;
.source "BbsCarTypeActivity.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/bitauto/autoeasy/BaseActivity;",
        "Landroid/widget/AdapterView$OnItemClickListener;"
    }
.end annotation


# instance fields
.field private BrandList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/bbs/Object/BbsCarType;",
            ">;"
        }
    .end annotation
.end field

.field private listView:Landroid/widget/ListView;

.field private url:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 24
    invoke-direct {p0}, Lcom/bitauto/autoeasy/BaseActivity;-><init>()V

    .line 28
    const-string v0, ""

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->url:Ljava/lang/String;

    .line 24
    return-void
.end method


# virtual methods
.method public initView()V
    .locals 4

    .prologue
    .line 39
    const v1, 0x7f03002a

    invoke-virtual {p0, v1}, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->setLayout(I)V

    .line 40
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->setTitleContent()V

    .line 41
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->getIntent()Landroid/content/Intent;

    move-result-object v1

    const-string v2, "bsid"

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v0

    .line 42
    .local v0, suffix:I
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "http://m.bitauto.com/iphoneapi/v2/bbs_listbybigbrand/?bsid="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->url:Ljava/lang/String;

    .line 44
    const v1, 0x102000a

    invoke-virtual {p0, v1}, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ListView;

    iput-object v1, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->listView:Landroid/widget/ListView;

    .line 45
    iget-object v1, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v1, p0}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 46
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 0
    .parameter "savedInstanceState"

    .prologue
    .line 32
    invoke-super {p0, p1}, Lcom/bitauto/autoeasy/BaseActivity;->onCreate(Landroid/os/Bundle;)V

    .line 34
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->initView()V

    .line 35
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->refreshView()V

    .line 36
    return-void
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 3
    .parameter
    .parameter "view"
    .parameter "position"
    .parameter "id"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .line 71
    .local p1, parent:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/bitauto/autoeasy/bbs/BbsListActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 72
    .local v0, intent:Landroid/content/Intent;
    const-string v2, "bbsid"

    iget-object v1, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v1, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/bitauto/autoeasy/bbs/Object/BbsCarType;

    invoke-virtual {v1}, Lcom/bitauto/autoeasy/bbs/Object/BbsCarType;->getBbsid()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 73
    const-string v2, "image"

    iget-object v1, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v1, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/bitauto/autoeasy/bbs/Object/BbsCarType;

    invoke-virtual {v1}, Lcom/bitauto/autoeasy/bbs/Object/BbsCarType;->getImage()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 74
    const-string v2, "title"

    iget-object v1, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v1, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/bitauto/autoeasy/bbs/Object/BbsCarType;

    invoke-virtual {v1}, Lcom/bitauto/autoeasy/bbs/Object/BbsCarType;->getBbsname()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 75
    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->startActivity(Landroid/content/Intent;)V

    .line 76
    return-void
.end method

.method public refreshView()V
    .locals 4

    .prologue
    .line 51
    :try_start_0
    new-instance v1, Lcom/bitauto/autoeasy/bbs/Object/BbsCarTypeParser;

    iget-object v3, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->url:Ljava/lang/String;

    invoke-direct {v1, v3}, Lcom/bitauto/autoeasy/bbs/Object/BbsCarTypeParser;-><init>(Ljava/lang/String;)V

    .line 52
    .local v1, bParser:Lcom/bitauto/autoeasy/bbs/Object/BbsCarTypeParser;
    invoke-virtual {v1}, Lcom/bitauto/autoeasy/bbs/Object/BbsCarTypeParser;->Paser2Object()V

    .line 53
    invoke-virtual {v1}, Lcom/bitauto/autoeasy/bbs/Object/BbsCarTypeParser;->getList()Ljava/util/ArrayList;

    move-result-object v3

    iput-object v3, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->BrandList:Ljava/util/ArrayList;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 57
    .end local v1           #bParser:Lcom/bitauto/autoeasy/bbs/Object/BbsCarTypeParser;
    :goto_0
    iget-object v3, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->BrandList:Ljava/util/ArrayList;

    if-eqz v3, :cond_0

    iget-object v3, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-lez v3, :cond_0

    .line 58
    new-instance v0, Lcom/bitauto/autoeasy/bbs/Adapter/BbsCarTypeAdapter;

    invoke-direct {v0, p0}, Lcom/bitauto/autoeasy/bbs/Adapter/BbsCarTypeAdapter;-><init>(Landroid/app/Activity;)V

    .line 59
    .local v0, adapter:Lcom/bitauto/autoeasy/bbs/Adapter/BbsCarTypeAdapter;
    iget-object v3, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v0, v3}, Lcom/bitauto/autoeasy/bbs/Adapter/BbsCarTypeAdapter;->setList(Ljava/util/ArrayList;)V

    .line 60
    iget-object v3, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v0, v3}, Lcom/bitauto/autoeasy/bbs/Adapter/BbsCarTypeAdapter;->setListView(Landroid/widget/ListView;)V

    .line 62
    iget-object v3, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v3, v0}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 66
    .end local v0           #adapter:Lcom/bitauto/autoeasy/bbs/Adapter/BbsCarTypeAdapter;
    :goto_1
    return-void

    .line 54
    :catch_0
    move-exception v3

    move-object v2, v3

    .line 55
    .local v2, e:Ljava/lang/Exception;
    const/4 v3, 0x0

    iput-object v3, p0, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->BrandList:Ljava/util/ArrayList;

    goto :goto_0

    .line 64
    .end local v2           #e:Ljava/lang/Exception;
    :cond_0
    const v3, 0x7f030016

    invoke-virtual {p0, v3}, Lcom/bitauto/autoeasy/bbs/BbsCarTypeActivity;->setContentView(I)V

    goto :goto_1
.end method
